package com.bankcard.bininfo.model;

import com.bankcard.util.I18nManager;

import java.util.Locale;

/**
 * Represents a card brand in the banking system.
 * This interface defines the basic properties and methods for a card brand.
 */
public interface CardBrand {
    /**
     * Gets the name of the card brand.
     *
     * @return The name of the card brand as a String.
     */
    String getName();

    /**
     * Gets the code of the card brand.
     *
     * @return The code of the card brand as a String.
     */
    String getCode();

    /**
     * Gets the description key for the card brand.
     * This key is used for internationalization purposes.
     *
     * @return The description key as a String.
     */
    default String getDescKey() {
        return "card.brand." + getCode() + ".desc";
    }

    /**
     * Gets the localized description of the card brand using the default locale.
     *
     * @return The localized description of the card brand as a String.
     */
    default String getDesc() {
        return I18nManager.getInstance().getString(getDescKey());
    }

    /**
     * Gets the localized description of the card brand for a specific locale.
     *
     * @param locale The locale for which to get the description.
     * @return The localized description of the card brand as a String.
     */
    default String getDesc(Locale locale) {
        return I18nManager.getString(getDescKey(), locale);
    }
}